<template>
    <h2>我是About的内容</h2>
</template>

<script>
//组件切换会导致组件频繁的创建和切换
    export default {
        name:'About',
        mounted(){
            console.log('About组件挂载了')
        },
        beforeDestroy(){
            console.log('About组件销毁前')
        },
        //必须通过路由规则[有些情况不属于通过路由规则进入]，进入该组件时被调用
        beforeRouteEnter(to, from, next){
            console.log('beforeRouteEnter')
            next()
        },
        //通过路由规则，离开该组件时被调用
        beforeRouteLeave(to, from, next){
            console.log('beforeRouteLeave')
            next()
        }
    }
</script>

<style>

</style>